home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1996 June / EnigmA AMIGA RUN 08 (1996)(G.R. Edizioni)(IT)[!][issue 1996-06][EARSAN CD VII].iso / earcd / amos / guicomp.lha / CompilerPatch.Amos / CompilerPatch.amosSourceCode < prev   
AMOS Source Code  |  1992-09-02  |  3KB  |  103 lines

  1. '~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~  
  2. '
  3. '    Name: AMOSPro Compiler Patch
  4. '  Author: Pietro Ghizzoni 
  5. '  E-Mail: ghizzo@galactica.it   
  6. ' Version: 1.1 
  7. '
  8. ' This program create a COPY of the compiler files WITHOUT modify  
  9. ' the originals! :)      
  10.  
  11.  
  12. Global S,PATH$
  13.  
  14. Reserve As Work 10,30000 : S=Start(10) : PATH$=Resource$(0)
  15. C$=PATH$+"Apcmp" : Trap Open In 1,C$
  16.  
  17. If Errtrap
  18.    
  19.    Repeat 
  20.       C$=Fsel$("APcmp","","Load the compiler....")
  21.    Until Right$(Upper$(C$),5)="APCMP"
  22.    PATH$=Left$(C$,Len(C$)-5)
  23.    
  24. Else 
  25.    
  26.    Close 
  27.    
  28. End If 
  29.  
  30.  
  31. 'Load the compiler 
  32. '~~~~~~~~~~~~~~~~~~~ 
  33. Print "Patch the compiler!"
  34. L0AD["APcmp",29528]
  35.  
  36. 'Patch the compiler
  37. '~~~~~~~~~~~~~~~~~~~~
  38. Poke$ S+28706,"s/AMOSPro_Gui_Comp_Config"+Chr$(0)
  39. Poke$ S+28732,"s:AMOSPro_Gui_Comp_Config"+Chr$(0)
  40. Poke$ S+28758,"Libs:Gui.Library"+Chr$(0)
  41.  
  42. 'Save the patched compiler 
  43. '~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
  44. Bsave PATH$+"GUICmp",S To S+29528
  45.  
  46.  
  47. 'Load the Header_BackStart Library 
  48. '~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
  49. Print "Patch the Header_BackStart.Lib"
  50. L0AD["Header_BackStart.Lib",3436]
  51.  
  52. 'Pacth the lib 
  53. '~~~~~~~~~~~~~~~ 
  54. Poke$ S+3046,"Gui.Library "+Chr$(0)
  55. Poke$ S+3076,"Libs:Gui.Library"+Chr$(0)
  56. Poke$ S+3094,"APSystem/Gui.Library"+Chr$(0)
  57. Poke$ S+3116,"Libs/Gui.Library"+Chr$(0)
  58.  
  59. 'Save the patched library
  60. '~~~~~~~~~~~~~~~~~~~~~~~~~~
  61. Bsave PATH$+"Gui_BackStart.Lib",S To S+3436
  62.  
  63.  
  64. 'Load the Header_CLI Library 
  65. '~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
  66. Print "Patch the Header_CLI.Lib"
  67. L0AD["Header_CLI.Lib",2928]
  68.  
  69. 'Patch the lib 
  70. '~~~~~~~~~~~~~~~ 
  71. Poke$ S+2816,"Gui.Library "+Chr$(0)
  72. Poke$ S+2846,"Libs:Gui.Library"+Chr$(0)
  73. Poke$ S+2864,"APsystem/Gui.Library"+Chr$(0)
  74. Poke$ S+2886,"Libs/Gui.Library"+Chr$(0)
  75.  
  76. 'Save the patched library
  77. '~~~~~~~~~~~~~~~~~~~~~~~~~~
  78. Bsave PATH$+"Gui_CLI.Lib",S To S+2928
  79.  
  80. 'Save the AMOS.Library Patched Version ( Gui.Library ) 
  81. '~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
  82. Print "Patch Amos.Library -> GUI.Library"
  83. Bsave "Libs:"+"Gui.Library",Start(7) To Start(7)+46948
  84.  
  85. 'Save the new GUI-Compiler config file 
  86. '~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
  87. Print "Save new compiler configuration file"
  88. Bsave "S:AMOSPro_Gui_Comp_Config",Start(8) To Start(8)+1522
  89. Print "Done!"
  90.  
  91. Procedure ERR[M$]
  92.    Print M$ : Boom : End 
  93. End Proc
  94. Procedure L0AD[FILE$,SIZE]
  95.    
  96.    Trap Open In 1,PATH$+FILE$
  97.    If Errtrap Then ERR[FILE$+" no found!"]
  98.    If Lof(1)><SIZE Then ERR["This isn't the orginal "+FILE$]
  99.    Bload PATH$+FILE$,S : Trap Close 
  100.    
  101. End Proc
  102.  
  103. '                    Contact me! -> ghizzo@galactica.it